package com.xyoto.takeawayBusiness.mapper;

import com.xyoto.takeawayBusiness.po.OrderShoppingPO;
import com.xyoto.takeawayBusiness.po.OrdersPO;
import com.xyoto.takeawayBusiness.po.ShoppingGoodPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderMapper {

    /**
     * 接单打印
     * @param orderId
     * @return
     */
    Integer orderReceiving(String orderId);

    /**
     * 根据订单类型查询订单列表
     * @param orderType
     * @return
     */
    List<OrdersPO> getOrderListByOrderType(Integer orderType);

    /**
     * 通过订单id获取订单商品项
     * @param id
     * @return
     */
    List<OrderShoppingPO> getOrdersItems(String id);

    /**
     * 通过商品id获取商品规格
     * @param shoppingId
     * @return
     */
    ShoppingGoodPO getShoppingGoods(Integer shoppingId);

    /**
     * 订单是否存在
     * @param orderId
     * @return
     */
    Integer isExistOrder(String orderId);

    /**
     * 修改订单状态
     * @param status
     * @param orderId
     * @param type
     * @return
     */
    Integer updateOrderStatus(@Param("status") Short status, @Param("orderId") String orderId, @Param("type") Short type);
}
